home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Taifun / Taifun 045 (1988-02-15)(Ossowski, Stefan)(DE)(PD).zip / Taifun 045 (1988-02-15)(Ossowski, Stefan)(DE)(PD).adf / Iff2Pcs / Source / popmenu.h < prev    next >
C/C++ Source or Header  |  1988-01-20  |  2KB  |  46 lines

  1. #ifndef POPUP_MENU_H
  2. #define POPUP_MENU_H
  3.  
  4. #include <stdio.h>
  5. #include <graphics/display.h>
  6. #include <graphics/gfxmacros.h>
  7. #include <intuition/intuition.h>
  8.  
  9. /* The following constants are the font characteristics of topaz eight :
  10.  * If you want a different font, you'll have to open it in the Init_MenuPackage
  11.  * and set these constants to the appropriate values.
  12.  */
  13. #define FONT_HEIGHT   8   /* pixel height of an average character */
  14. #define FONT_WIDTH    8   /* pixel width of an average character */
  15. #define FONT_BASELINE 6   /* relative pixel location of character baseline */
  16.  
  17. #define MAX(a,b) ((a > b) ? a : b)
  18.  
  19. #define NOITEM_SELECTED 0  /* returned from PopUp if no item was selected */
  20. #define OUTSIDE_WINDOW -1  /* returned from PopUp if cursor outside of window */
  21.  
  22. struct PopUp_Item {
  23.    char *text;                 /* text string to be displayed */
  24.    SHORT selection_id;             /* id returned when this item is selected */
  25.    SHORT left, top;              /* top/left offset within menu */
  26.    SHORT height,width;           /* desired height/width of selection box */
  27.    UBYTE color;                  /* desired text color (= color register) */
  28.    struct PopUp_Item *next;      /* link to next menu item */
  29. };
  30.  
  31. struct PopUp_Menu {
  32.    SHORT depth;                     /* number of bit-planes to use */
  33.    SHORT left,top, height;          /* used internally */
  34.    SHORT width;                  /* desired width of menu */
  35.    USHORT deactivate;               /* what MOUSEBUTTON deactives the menu */
  36.    UBYTE outline_color, area_color; /* color registers */
  37.    struct ClipRect cr;              /* clipping rectangle for display */
  38.    struct RastPort rp;              /* raster port for drawing into menu area */
  39.    struct BitMap bitmap;            /* actual bitmap for rendering the menu */
  40.    struct PopUp_Item *first_item;   /* first in list of menu items */
  41.    struct PopUp_Item *active_item;  /* for internal use only */
  42. };
  43.  
  44. #define Inside_Window(x,y,w)(((x)>0)&&((x)<(w)->Width)&&((y)>0)&&((y)<(w)->Height))
  45. #endif
  46.